Made 4 copies of the last 2 chars¶
S1 * 4
Write a python function to get a string made of 4 copies of the last
two characters of a specified string (length must be at least 2).
Sample function and result :
insert_end(‘Python’) -> onononon
insert_end(‘Exercises’) -> eseseses
def insert_end(S):
S1 = S[-2:]
return S1 * 4
# test
print(insert_end('Python')) # onononon
print(insert_end('Exercises')) # eseseses